Method and apparatus for obtaining sample images, and electronic device

ABSTRACT

Embodiments of the present disclosure provide methods and apparatuses for obtaining sample images, and electronic devices. The method includes: acquiring images of stacked bodies, where the stacked bodies in different images have different item information, and the item information comprises: an attribute and a stacking mode of a stacked body; and taking an acquired image as a sample image when the acquired image meets an image quality condition.

CROSS-REFERENCE TO RELATED APPLICATION

The present application is a continuation of International ApplicationNo. PCT/IB2020/052987, filed on Mar. 30, 2020, which claims a priorityof the Singaporean patent application No. 10201913056V filed on Dec. 23,2019, all of which are incorporated herein by reference in theirentirety.

TECHNICAL FIELD

The present disclosure relates to a machine learning technology, andspecifically relates to methods and apparatuses for obtaining sampleimages, and electronic devices.

BACKGROUND

In recent years, with continuous development of an artificialintelligence technology, the artificial intelligence technology achievesgood effects in aspects such as computer vision and speech recognition.Game currencies used in a game are required for recognizing in somerelatively special scenes such as a tabletop game scene. Automaticallyrecognizing game currencies in a game is also an important researchtopic for constructing an intelligent game place. Moreover, as aprecondition of recognizing game currencies in a game, acquiring asample image including a game currency for training a recognitionnetwork to recognize game currencies is an essential step. The qualityof the sample image directly affects the precision of game currencyrecognition.

SUMMARY

In view of this, the present disclosure at least provides a method andapparatus for obtaining sample images, and an electronic device.

According to a first aspect, provided is a method for obtaining sampleimages, including:

acquiring images of stacked bodies, where the stacked bodies indifferent images have different item information, and the iteminformation includes: an attribute and a stacking mode of a stackedbody; and

taking an acquired image as a sample image when the acquired image meetsan image quality condition.

According to any one of embodiments of the present disclosure, themethod further includes: determining that distribution data of iteminformation of stacked bodies in sample images of a sample image setdoes not meet a predetermined distribution condition, the sample imageset including multiple sample images; and acquiring a missing imagewhich is an image of a stacked body having missing item information notincluded in the distribution data but included in the predetermineddistribution condition.

According to any one of embodiments of the present disclosure, afteracquiring the missing image, the method further includes: taking themissing image as a sample image when the missing image meets the imagequality condition.

According to any one of embodiments of the present disclosure, thestacking mode includes: a stacking direction, a stacking area, aneighboring relation among objects constituting the stacked body, andthe number of objects in the stacked body; the attribute of the stackedbody includes: a value represented by each object constituting thestacked body and a type of each object; stacked bodies in differentsample images are different from each other in at least one of: astacking direction, a stacking area, a neighboring relation amongobjects constituting a stacked body, the number of objects in a stackedbody, a value represented by each object constituting a stacked body ora type of each object.

According to any one of embodiments of the present disclosure, acquiringimages of stacked bodies includes: acquiring N image subsets, wherestacked bodies in images of the same image subset have the same firstattribute, the first attribute is one of the value and the type, N is anatural number, and stacked bodies in images of different image subsetshave different first attributes; where the attributes of stacked bodiesin images of one of the N image subsets include different possiblecombinations of second attributes, the attribute of the stacked body isdetermined by a second attribute of each object constituting the stackedbody, and the second attribute is one of the value and the type otherthan the first attribute.

According to any one of embodiments of the present disclosure, when thestacking direction is parallel to a surface on which the stacked body isplaced, acquiring images of stacked bodies includes: acquiring images ofstacked bodies at an overhead view of the surface.

According to any one of embodiments of the present disclosure, when thestacking direction is perpendicular to the surface on which the stackedbody is placed, acquiring images of stacked bodies includes: acquiringimages of stacked bodies at a side view of the surface.

According to any one of embodiments of the present disclosure, takingthe acquired image as the sample image when the acquired image meets theimage quality condition includes: for each of target objects in theacquired image, determining a bounding box of the target object, thetarget objects including a stacked body; for each of the target objectsother than the stacked body, determining that an Intersection over Unionbetween a bounding box of the stacked body and a bounding box of thetarget object is less than a first predetermined threshold; and takingan acquired image as the sample image.

According to any one of embodiments of the present disclosure, afterdetermining that the Intersection over Union between the bounding box ofthe stacked body and the bounding box of each of the target objectsother than the stacked body is less than the first predeterminedthreshold, and before taking the acquired image as the sample image, themethod further includes: taking the bounding box of the stacked body asa first bounding box; for each of the target objects other than thestacked body in the acquired image, taking the bounding box of thetarget object as a second bounding box; determining that a ratio of alength of an overlapping area between the first bounding box and thesecond bounding box in a direction perpendicular to a stacking directionof the stacked body to a length of the first bounding box in thedirection perpendicular to the stacking direction of the stacked body isless than a second predetermined threshold.

According to a second aspect, provided is an apparatus for obtainingsample images, including:

an image acquisition module, configured to acquire images of stackedbodies, where the stacked bodies in different images have different iteminformation, and the item information includes: an attribute and astacking mode of a stacked body; and

an image filtering module, configured to take an acquired image as asample image when the acquired image meets an image quality condition.

According to any one of embodiments of the present disclosure, the imageacquisition module is further configured to acquire a missing image whenit is determined that distribution data of item information of stackedbodies in sample images of a sample image set does not meet apredetermined distribution condition, where the missing image is animage of a stacked body having missing item information not included inthe distribution data but included in the predetermined distributioncondition; the sample image set including multiple sample images.

According to any one of embodiments of the present disclosure, the imagefiltering module is further configured to take the missing image as asample image when the missing image meets the image quality condition.

According to any one of embodiments of the present disclosure, thestacking mode includes: a stacking direction, a stacking area, aneighboring relation among objects constituting the stacked body, andthe number of objects in the stacked body; the attribute of the stackedbody includes: a value represented by each object constituting thestacked body and a type of each object; stacked bodies in differentsample images are different from each other in at least one of: astacking direction, a stacking area, a neighboring relation amongobjects constituting a stacked body, the number of objects in a stackedbody, a value represented by each object constituting a stacked body ora type of each object.

According to any one of embodiments of the present disclosure, the imageacquisition module is configured to acquire N image subsets, wherestacked bodies in images of the same image subset have the same firstattribute, the first attribute is one of the value and the type, N is anatural number, and stacked bodies in images of different image subsetshave different first attributes; where the attributes of stacked bodiesin images of one of the N image subsets include different possiblecombinations of second attributes, the attribute of the stacked body isdetermined by a second attribute of each object constituting the stackedbody, and the second attribute is one of the value and the type otherthan the first attribute.

According to any one of embodiments of the present disclosure, the imageacquisition module is configured to, when the stacking direction isparallel to a surface on which the stacked body is placed, acquireimages of stacked bodies at an overhead view of the surface.

According to any one of embodiments of the present disclosure, the imageacquisition module is configured to, when the stacking direction isperpendicular to the surface on which the stacked body is placed,acquire images of stacked bodies at a side view of the surface.

According to any one of embodiments of the present disclosure, the imagefiltering module is specifically configured to for each of targetobjects in the acquired image, determine a bounding box of the targetobject, the target objects including a stacked body; for each of thetarget objects other than the stacked body, determine that anIntersection over Union between a bounding box of the stacked body and abounding box of the target object is less than a first predeterminedthreshold; and take the acquired image as the sample image.

According to any one of embodiments of the present disclosure, the imagefiltering module is further configured to, after determining that theIntersection over Union between the bounding box of the stacked body andthe bounding box of each of the target objects other than the stackedbody is less than the first predetermined threshold, and before takingthe acquired image as the sample image, take the bounding box of thestacked body as a first bounding box; for each of the target objectsother than the stacked body in the acquired image, take the bounding boxof the target object as a second bounding box; determine that a ratio ofa length of an overlapping area between the first bounding box and thesecond bounding box in a direction perpendicular to a stacking directionof the stacked body to a length of the first bounding box in thedirection perpendicular to the stacking direction of the stacked body isless than a second predetermined threshold.

According to a third aspect, provided is an electronic device, includinga memory and a processor, where the memory is configured to storecomputer instructions runnable on the processor, and the processor isconfigured to implement the method according to any one of embodimentsof the present disclosure when the computer instructions are executed.

According to a fourth aspect, provided is a computer-readable storagemedium. A computer program is stored thereon, and when the program isexecuted by a processor, the method according to any one of embodimentsof the present disclosure is implemented.

According to the methods and apparatuses for obtaining sample images,and electronic devices provided in embodiments of the presentdisclosure, the item information included in the acquired sample imagesis relatively rich by acquiring multiple images having different iteminformation. Moreover, the quality of the sample images can also befurther improved by selecting the acquired images of better quality, sothat the sample images which are of better quality and includes richitem information are used for training a neural network, and theperformance of the neural network to recognizing objects in a stackedbody is improved, for example, the accuracy and the generalizationcapability of a recognition network to recognize objects in a stackedbody are improved.

BRIEF DESCRIPTION OF THE DRAWINGS

To describe the technical solutions in one or more embodiments of thepresent disclosure or the related art more clearly, the accompanyingdrawings for describing the embodiments or the related art are brieflyintroduced below. Apparently, the accompanying drawings in the followingdescription show merely some embodiments described in the one or moreembodiments of the present disclosure, and a person of ordinary skill inthe art can still derive other accompanying drawings from theseaccompanying drawings without involving an inventive effort.

FIG. 1 is a flowchart of a method for obtaining sample images providedby at least one embodiment of the present disclosure;

FIG. 2 is a diagram of a game table scene provided by at least oneembodiment of the present disclosure;

FIG. 3 is a diagram of a stacking mode of game currencies provided by atleast one embodiment of the present disclosure;

FIG. 4 is a diagram of a storage area provided by at least oneembodiment of the present disclosure;

FIG. 5 is a diagram of another stacking mode of game currencies providedby at least one embodiment of the present disclosure;

FIG. 6 is a diagram of an apparatus for obtaining sample images providedby at least one embodiment of the present disclosure.

DETAILED DESCRIPTION OF THE EMBODIMENTS

To make a person skilled in the art better understand the technicalsolutions in one or more embodiments of the present disclosure, thetechnical solutions in the one more embodiments of the presentdisclosure are clearly and fully described below with reference to theaccompanying drawings in the one or more embodiments of the presentdisclosure. Apparently, the described embodiments are merely some of theembodiments of the present disclosure, but not all the embodiments.Based on the one or more embodiments of the present disclosure, allother embodiments obtained by a person of ordinary skill in the artwithout involving an inventive effort shall fall within the scope ofprotection of the present disclosure.

Embodiments of the present disclosure provide a method for obtainingsample images. The method can be used for obtaining a sample image. Thesample image can be, for example, used for training a neural network.

The sample image can include a stacked body. The stacked body caninclude multiple objects stacked together, for example, multiple gamecurrencies stacked together, or multiple sheet-like objects such asmultiple coins stacked together. However, when the sample image is usedfor training a neural network, the neural network trained with thesample image can be used for recognizing the stacked body (i.e.,recognizing objects constituting the stacked body).

FIG. 1 shows a flowchart of a method for obtaining sample imagesprovided by at least one embodiment of the present disclosure. As shownin FIG. 1, the method includes the following steps 100-102.

At step 100, images of stacked bodies are acquired, where the stackedbodies in different images have different item information, and the iteminformation includes: an attribute and a stacking mode of a stackedbody.

At this step, multiple images can be acquired. Each image can include astacked body. Stacked bodies in different images can be different fromeach other in at least one of the following item information: forexample, the attributes of stacked bodies in different images aredifferent, or the stacking modes of stacked bodies in different imagesare different, or both the attributes and the stacking modes aredifferent.

In an example, the attribute of the stacked body may include: the valuerepresented by each object constituting the stacked body and a type ofeach object. Taking a stacked body including multiple coins stackedtogether as an example, the value can be the denomination of a coin, forexample, 1 RMB coin and 5 RMB coin. The type can be the type of a coin(for example, coins in different countries; a coin in each country is ofthe same type). For example, coins can be of multiple types, and thestacked body can include coins of different types.

In an example, the stacking mode of the stacked body can include: astacking direction, a stacking area, a neighboring relation amongobjects constituting the stacked body, and the number of objects in thestacked body.

For example, the stacking direction can include: a first direction or asecond direction, where the first direction can be parallel to a surfaceon which objects in a stacked body are placed; and the second directioncan be perpendicular to a surface on which the objects in the stackedbody are placed. Objects in the stacked body can be stacked along thefirst direction or the second direction.

For example, a surface on which objects in a stacked body are placed caninclude multiple stacking areas, and stacked bodies in the acquireddifferent images can be placed in different stacking areas,respectively. Furthermore, the neighboring relation among objectsconstituting the stacked bodies in different images can also bedifferent. For example, two images both include 1 RMB coin, 5 RMB coin,and 10 RMB coin. 5 RMB coin in one image is located in the middle of astacked body, and 1 RMB and 10 RMB coins are located on both sides ofthe stacked body. 10 RMB coin in the other image is located in themiddle of a stacked body, and 1 RMB and 5 RMB coins are located on bothsides of the stacked body.

At step 102, an acquired image is taken as a sample image when theacquired image meets an image quality condition.

At this step, the quality of the images acquired in step 100 can befiltered to select an image meeting the image quality condition as asample image, where the image quality condition can be set according toactual service requirements, for example, the image quality condition isthat a stacked body in an image is not shielded by other objects in theimage at all. The image quality condition can be achieved by setting aselecting process algorithm.

According to the method for obtaining sample images provided in thepresent embodiments, the item information included in the acquiredsample images is relatively rich by acquiring multiple images havingdifferent item information. Moreover, the quality of the sample imagescan also be further improved by selecting the acquired images of betterquality, so that the sample images which are of better quality andincludes rich item information are used for training a neural network,and the performance of the neural network to recognizing objects in astacked body is improved, for example, the accuracy and thegeneralization capability of a recognition network to recognize objectsin a stacked body are improved.

With continuous development of an artificial intelligence technology,the intelligent construction is attempted to be made in a large varietyof places. For example, one topic is the construction of an intelligentgame place. In this case, one of requirements of the intelligent gameplace is to automatically recognize game currencies used in a game, forexample, automatically recognize the number of game currencies.According to the method for obtaining sample images provided inembodiments of the present disclosure, the sample image acquired by thismethod can be used for training a game currency recognition network. Thegame currency recognition network is used for recognizing gamecurrencies used in a game.

Taking acquiring images of stacked bodies in a tabletop game scene as anexample below, the method for obtaining sample images in embodiments ofthe present disclosure is described. In an exemplary tabletop gamescene, multiple players sit around a game table which includes multiplegame areas. Different game areas have different game meanings. Thesegame areas can be different stacking areas in the description below.Moreover, in a multiplayer game, users can play a game via gamecurrencies.

For example, a user can exchange game currencies with his/her own goods,and place the game currencies in different stacking areas of the gametable for playing a game. For example, a first user exchanges gamecurrencies used in the game with multiple watercolor pens owned byhim/her, and uses the game currencies to play a game in accordance withthe game rule among different stacking areas of the game table. If asecond user wins over the first user in the game, the watercolor pens ofthe first user belong to the second user. For example, the game above issuitable for pleasure of multiple family members in leisure time such asa holiday.

In the image acquisition scene of the game currency, game currenciesincluded in different images can be different from each other in atleast one of the following: the game currency denomination, the gamecurrency type, the game currency stacking direction, the stacking area,the neighboring relation among game currencies (for example, gamecurrencies of different denominations or different types) included in astacked body, or the number of game currencies included in a stackedbody.

For example, an image includes five game currencies which are placed byusers who participate in the game in one stacking area on the left ofthe game table. Another image includes five game currencies which areplaced in one stacking area on the right of the game table.Alternatively, an image includes three game currencies of type A andfive game currencies of type B, and another image includes four gamecurrencies of type A and seven game currencies of type C. Other examplesare not described again.

Next, taking the game table shown in FIG. 2 as an example, a sampleimage acquisition method is described. As shown in FIG. 2, users canplay a game on a game table 20 in a game scene, and images of gamecurrencies placed in stacking areas of the game table are acquired bycameras 211 and 212 on both sides. A user 221, a user 222, and a user223 who participate in the game are located at one side of the gametable 20, and can be called as first users. The other user 23 whoparticipates in the game is located at the other side of the game table20, and can be called as a second user. The second user can be a userwho is in charge of controlling the game process in the game.

At the beginning stage of the game, first users exchange game currenciesfrom the second user with their own goods (such as watercolor pens orother goods that may be interested by users), and the second user handsover the game currencies placed in a storage area 27 to the first users.Next, the first users place the game currencies in betting areas 241,242 of the game table, such as a betting area 241 placed by the firstuser 222 and a betting area 242 placed by the first user 223. During thegame playing stage, a device 25 for sending poker card sends poker cardsto a game playing area 26 to play the game. After the game is ended, thesecond user can determine the game result according to the poker cardswithin the game playing area 26, and adds game currencies of the firstuser who is a winner in the game. The storage area 27, the betting area241, the betting area 242, etc. are called as stacking areas.

In addition, it can also be seen from FIG. 2 that the game tableincludes multiple betting areas such as the betting area 241 and thebetting area 242. The stacking direction of game currencies in thebetting area can be shown in FIG. 3, for example, multiple gamecurrencies are stacked along a direction vertical to the game tabletop.

As shown in FIG. 3, the stacked body includes multiple game currencies,and the stacking direction of the game currencies is along the directionperpendicular to a surface (i.e., a game tabletop) on which the stackedbody is placed. An image of the stacked body can be acquired at a sideview of the game tabletop. The image acquired at the side view issimilar to that in FIG. 3.

By continuing referring to FIG. 2, an image acquisition apparatus can beprovided around the game table for acquiring an image of game currenciesplaced on the game table. The image of game currencies may be taken as asample image for training a game currency recognition network. The imageacquisition apparatus can be, for example, a camera. For example, avideo stream of objects on the game table can be photographed by thecamera, and video frames in the video stream are obtained to be taken asthe acquired image. In an example, first image acquisition apparatusesare provided on the left and right (or multiple sides) of the game tablefor acquiring an image of a betting area. The game currencies in theimage of the betting area are placed in the betting area. For example,the cameras (such as side cameras 211 and 212) on the left and right ofthe game table can acquire images of the betting area, which are similarto images in which the game currencies are placed along the stackingdirection shown in FIG. 3 (which can be called as a first stackingdirection).

The game table can further include multiple storage areas. Asillustrated in FIG. 4, multiple storage areas 27 of the game currenciesare available. Each storage area 27 can be in a form of slot. Thestacking direction of the game currencies in the storage area can bedifferent from the stacking direction thereof in the betting area. Forexample, as illustrated in FIG. 5, multiple game currencies arehorizontally arranged along a direction parallel to the game tabletop.

As shown in FIG. 5, the stacked body includes multiple game currencies,and the stacking direction of the game currencies is along the directionparallel to a surface (i.e., a game tabletop) on which the stacked bodyis placed. An image of the stacked body can be acquired at anoverhead/top view of the game tabletop. The image acquired at the topview is similar to that in FIG. 5. Taking an example, a second imageacquisition apparatus (for example, a top mounted camera) can also beprovided above the game table for acquiring an image of the storage areaat an overhead view. The game currencies in the image of the storagearea are placed in the storage area, and the stacking direction of thegame currencies in the storage area is similar to that shown in FIG. 5(which can be called as a second stacking direction). The stackingdirections of the game currencies in the image of the betting area andthe image of the storage area are different.

In an example, the image acquired by first image acquisition apparatusescan be used for training a first game currency recognition network. Thefirst game currency recognition network is used for recognizing thedenomination, the number of game currencies stacked along the firststacking direction in the betting area, etc. In an actualimplementation, the first image acquisition apparatuses can includecameras on the left and right of the game table. The two cameras canphotograph all the areas on the whole game table at left side view andright side view. The image acquired by a second image acquisitionapparatus can be used for training a second game currency recognitionnetwork. The second game currency recognition network is used forrecognizing information such as the denomination and the number of gamecurrencies stacked along the second stacking direction in the storagearea. In an actual implementation, the second image acquisitionapparatus can include a camera above the game table. The camera canphotograph all the areas on the whole game table in a bird's-eye view.Optionally, in other examples, both the game currencies in the storagearea and the game currencies in the betting area can be recognized bythe same game currency recognition network.

In order to improve the network performance of the game currencyrecognition network, the acquired image of the game currencies on thegame table can be richer. In this way, the generalization capability ofthe trained recognition network can be improved by rich sample imagesand wide coverage for the game tabletop.

In some embodiments, N image subsets can be acquired, where each imagesubset can include multiple images; stacked bodies in images of the sameimage subset have the same first attribute; the first attribute is oneof the value and the type; N is a natural number; stacked bodies inimages of different image subsets have different first attributes.Moreover, the attributes of stacked bodies in images of one of the Nimage subset include different possible combinations of secondattributes, the attribute of the stacked body is determined by a secondattribute of each object constituting the stacked body, and the secondattribute is one of the value and the type other than the firstattribute.

For example, taking one of the N image subsets as an example, the gamecurrencies constituting stacked bodies in multiple images of the imagesubset are of the same type, and the denomination of the game currenciesin the multiple images are different. For example, some images includegame currencies having denominations of 2 RMB and 5 RMB, and some imagesinclude game currencies having denominations of 5 RMB, 7 RMB, and 10RMB. For another example, even though the denominations of the gamecurrencies in two images are 5 RMB, 7 RMB, and 10 RMB, the neighboringrelation among game currencies of three denominations can be different,or the number of respective game currencies of the three denominationsis different.

Images acquired by image acquisition apparatuses are shown below:

For example, the attribute of game currencies can include, but notlimited to: the denomination and the type of a game currency.

In an example, denominations of game currencies can include multiple,such as 0.5, 2.5, 5, 10, 25, 50, 100, 500, 1,000, 5,000, and 10,000.Types of game currencies can include multiple, for example, gamecurrencies used in different game places belong to different types. Inan example, tens of types are included. Game currencies of differenttypes can have different quantities and different denominations, forexample, game currencies of one type can include eight denominations of10, 25, 50, 100, 500, 1,000, 5,000, and 10,000.

Based on the game currencies of multiple denominations and types, therichness of the acquired images of the game currencies placed in thestorage area or the betting area is respectively described below. Forthe betting area or the storage area, the item information of stackedbodies in the images of the acquired image set can be different. Theitem information of the stacked body can include the attribute of thestacked body and the stacking mode thereof. As mentioned above, theattribute of the stacked body can be the denomination or the type of thegame currencies in the stacked body, and the stacking mode of thestacked body can include the stacking direction of the game currencies,the stacking area, the neighboring relation among game currenciesconstituting the stacked body, and the number of game currencies in thestacked body. Image acquisition of game currencies in the betting area:

In an example, the acquired image set can include a first image subsetwhich can include multiple first images. The first attribute of gamecurrencies in different first images is the same, and the number of gamecurrencies and/or the stacking areas in which the game currencies arelocated in different first images are different. For example, taking thefirst attribute being the denomination of game currencies as an example,the denomination of game currencies in different first images is thesame, while the number of game currencies and/or the stacking areaswhere the game currencies in different first images are located aredifferent.

For example, by comparing different images in the acquired image set,multiple denomination mixing modes can be included in these differentimages. The denomination mixing mode can be mixing game currencies whichhave different denominations and are of the same type.

A. Mixing of one denomination: for example, assuming that gamecurrencies of the same type include eight denominations of 10, 25, 50,100, 500, 1,000, 5,000, and 10,000. In an example, a denomination (forexample, 100 is selected from the eight denominations) is included in afirst image subset. The first image subset can include 20 first imageswhich are acquired for game currencies vertically stacked in the bettingareas. The number of game currencies in different first images graduallyincreases, and the betting areas in which the game currencies arelocated are also different. For example, a first image in the firstimage subset includes one game currency located in betting area Z1 ofthe game table; a second first image in the first image subset includestwo game currencies located in betting area Z2 of the game table; athird first image in the first image subset includes three gamecurrencies located in betting area Z3 of the game table, etc.

B. Mixing of two denominations: for example, any two of eightdenominations of the same type can be selected, and a total of 28selections can be made, for example, “100 and 500”, “10 and 25”, etc.More examples are omitted. A second image subset can be acquired in anyone of the selections. The second image subset includes multiple secondimages. The game currencies in each second image include identical twodenominations, and the number of game currencies of respectivedenominations and/or the stacking areas in which the game currencies arelocated are different. Taking a combination of two denominations “100and 500” as an example:

a second image p1: starting from the game tabletop, when viewing thestacked game currencies from bottom to top, 1 game currency of thedenomination 500 is on the bottom, i.e., on the game tabletop, and 19game currencies of the denomination 100 are stacked above the gamecurrency of the denomination 500. That is, such stacking mode relates toplacing game currencies of the large denomination on the bottom, andplacing game currencies of the small denomination on the top. The totalnumber of game currencies of the two denominations is 20. The gamecurrencies in the second image P1 are placed in betting area Z1;

a second image p2: 2 game currencies of the denomination 500 and 18 gamecurrencies of the denomination 100 are included and located in bettingarea Z2;

a second image p3: 3 game currencies of the denomination 500 and 17 gamecurrencies of the denomination 100 are included and located in bettingarea Z3;

a second image p4: 4 game currencies of the denomination 500 and 16 gamecurrencies of the denomination 100 are included and located in bettingarea Z4;

in a similar way, more examples are omitted until the second imageincludes 19 game currencies of the denomination 500 and 1 game currencyof the denomination 100.

For each of the 28 selections, two denominations in the selection can beused for image acquisition by the mixing mode above, so that the gamecurrencies of respective denominations in different second images havedifferent quantities of objects in different stacking areas.

C. Mixing of three denominations: any three of eight denominations ofthe same type can be selected, and a total of 56 selections can be made,for example, “100, 500 and 1,000”, “10, 25 and 50”, etc. More examplesare omitted. A third image subset including multiple third images can beacquired in any one of the selections. The game currencies in each thirdimages of the third image subset include identical three denominations,and the number of game currencies of at least one denomination and/orthe stacking areas in which the game currencies are located aredifferent. Taking a combination of three denominations “100, 500 and1,000” as an example:

a third image M1: starting from the game tabletop, when viewing thestacked game currencies from bottom to top, a game currency of the largedenomination is on the bottom, a game currency of the small denominationis on the top, and the total number of game currencies of threedenominations is 20. In an example, 1 game currency of the denomination1,000, 1 game currency of the denomination 500 and 18 game currencies ofthe denomination 100 are included in the third image M1, and the gamecurrencies in the third image M1 are stacked in betting area Z1;

a third image M2: 1 game currency of the denomination 1,000, 2 gamecurrencies of the denomination 500, and 17 game currencies of thedenomination 100 are included and located in betting area Z2;

a third image M3: 1 game currency of the denomination 1,000, 3 gamecurrencies of the denomination 500, and 16 game currencies of thedenomination 100 are included and located in betting area Z3;

a third image M4: 2 game currencies of the denomination 1,000, 3 gamecurrencies of the denomination 500, and 15 game currencies of thedenomination 100 are included and located in betting area Z4;

Other combination modes are not described in details. In a word, thenumber of game currencies of at least one denomination and/or thestacking area in which the game currencies are located in differentthird images are different.

Images having mixing modes of three denominations, two denominations,etc. are listed above. Mixing modes of four denominations, fivedenominations, etc. can also be included, and are not described indetails. Each mixing mode corresponds to an image subset. the number ofgame currencies of at least one denomination and/or the stacking area ofgame currencies may be different in different images of the imagesubset.

In addition, the difference among different images in the acquired imageset (including multiple image subsets) can also include that differentmixing modes are used for the type of game currencies in stacked bodiesof different images. The type mixing mode can be mixing game currencieswhich have the same denomination and are of different types.

The type mixing mode is similar to the denomination mixing mode above.Taking an example below for illustration.

For example, for mixing of game currencies of two types, two types ofthe same denomination can be selected from eight types, and a total of28 selections can be made. A fourth image subset can be acquired in anyone of the selections. The fourth image subset includes multiple fourthimages in which game currencies include identical two types X1 and X2,and the number of game currencies of respective types and/or thestacking areas in which the game currencies are located in the fourthimages are different.

A fourth image N1: starting from the game tabletop, when viewing thestacked game currencies from bottom to top, 1 game currency of type X1is on the bottom, i.e., on the game tabletop, and 19 game currencies oftype X2 are stacked above the game currency of type X1. That is, suchstacking mode relates to placing game currencies of type X1 on thebottom, and placing game currencies of type X2 on the top. The totalnumber of game currencies of two types is 20. The game currencies in thefourth image N1 are placed in betting area Z1;

a fourth image N2: 2 game currencies of type X1 and 18 game currenciesof type X2 are included and located in betting area Z2;a fourth imageN3: 3 game currencies of type X1 and 17 game currencies of type X2 areincluded and located in betting area Z3;

a fourth image N4: 4 game currencies of type X1 and 16 game currenciesof type X2 are included and located in betting area Z4;

in a similar way, more examples are omitted until the fourth imageincludes 19 game currencies of type X1 and 1 game currency of type X2.Image acquisition of game currencies in the storage area:

The difference among different images in the acquired image set(including multiple image subsets) can also be that different mixingmodes are used for the denomination and the type of game currencies inthe storage area of different images, which is similar to the mixingmodes of the game currencies in the betting area.

The mixing mode of three denominations is shown as an example:

The mixing mode of three denominations in the storage area maycorrespond to a fifth image subset including multiple fifth images. Forexample, a fifth image has multiple storage areas. 60 game currenciescan be placed in storage area C1, and include three denominations. 20game currencies of each denomination are included.

In another fifth image, 55 game currencies are placed in storage areaC1, and five game currencies are placed in storage area C2 adjacent tostorage area C1. The five game currencies can be obtained by randomlyextracting from the 60 game currencies and placed in storage area C2.

In still another fifth image, 53 game currencies are placed in storagearea C1, and seven game currencies are placed in storage area C2adjacent to storage area C1. Compared with another fifth image, theincreased two game currencies in storage area C2 can be obtained byrandomly extracting from the 55 game currencies and placed in storagearea C2.

In a similar way, the operation is made until storage area C1 in a fifthimage is blank, and 60 game currencies are placed in storage area C2,i.e., 60 game currencies in storage area C1 are all transferred tostorage area C2. The game currencies are then continued moving fromstorage area C2 to storage area C3 adjacent to storage area C2 by themoving mode above, and multiple fifth images in the transfer process areobtained. The game currencies in different fifth images have identicalthree denominations. However, these denominations correspond todifferent quantities of game currencies in different storage areas.

The richness of the acquired image is exemplarily described above. Gamecurrencies having different item attributes are more balanced in theacquired images by the above mixing modes. For example, there is no bigdifference between the number of game currencies of the largedenomination in the acquired image set and the number of game currenciesof the small denomination in the acquired image set. For anotherexample, the image set can further include a large variety ofcombinations of game currencies of different denominations or differenttypes.

For images obtained by the method of obtaining sample images provided byembodiments of the present disclosure, the item information of gamecurrencies in the images is distributed uniformly, and the imagesinclude relatively comprehensive data. For example, the images of gamecurrencies of different denominations or different types are acquired,the number of game currencies of different denominations notsignificantly different from each other, and the number of gamecurrencies of different types is not significantly different from eachother. The problems such as “the number of game currencies of the largedenomination in the images is one hundredth even one thousandth as thenumber of game currencies of the common small denomination in theimages” and “uncommon combinations of game currencies of some largedenominations and game currencies of some small denominations hardlyappear or even never appear”, do not exist.

In an example, a distribution condition of game currency information canalso be set, and the distribution data of the game currency informationin the acquired image set is obtained. If the distribution data does notmeet the distribution condition, a missing image can be continuedacquiring, and can be an image of a stacked body having missing iteminformation not included in the distribution data but included in thepredetermined distribution condition.

For example, the distribution condition can be “the following image ofgame currencies does not exist: the percentage of the number of imagesof game currencies of a denomination in the total number of images inthe image set is lower than 2%.” Therefore, if it is found that thepercentage of the number of images of game currencies of thedenomination 100 in the total number of images in the image set is 1%,images of game currencies of the denomination 100 can be continuedacquiring. These images of game currencies of the denomination 100 aremissing images.

After the missing image is acquired, the quality of the missing imagecan also be filtered and when the missing images meets the image qualitycondition, the missing image is to selected as a sample image.

The following example shows how to select an image having good qualityas a sample image. Some of the acquired images have relatively badquality, and are not suitable for training the game currency recognitionnetwork. For example, game currencies in some images are shielded by ahand of a user, and some basis information of the game currencies forrecognizing the type or the denomination is shielded. Efficientrecognition cannot be carried out when the shielded images are used fortraining networks. Therefore, after the image set of game currenciesused in a game is acquired, images can be filtered according to theimage quality condition to select an image having good quality as asample image for training a game currency recognition network.

For example, a method for selecting images can include: firstdetermining bounding boxes of target objects in the acquired image, thetarget objects including a stacked body; multiple bounding boxes in theimage being included, for example, some bounding boxes including thestacked body, and some bounding boxes including other target objectsother than the stacked body in the image; next, when it is determinedthat an Intersection over Union (IoU) between the bounding box of thestacked body and a bounding box of each of other target objects (forexample, the target object can be a hand of a user who participates inthe game) is less than a first predetermined threshold (e.g. 50%),determining that the image is suitable for being taken as a sample imagefor training a game currency recognition network. Such selecting methodrelates to selecting an image in which a stacked body is shielded asless as possible as a sample image to avoid the influence of theshielding of the stacked body on network training.

In another example, after determining that an Intersection over Unionbetween the bounding box of the stacked body and the bounding box ofeach of other target objects is less than the first predeterminedthreshold, it can be continued determining whether a ratio of a lengthof an overlapping area of a first bounding box and a second bounding boxin a direction perpendicular to the stacking direction of the stackedbody to a length of a first bounding box in the direction perpendicularto the stacking direction of the stacked body is less than a secondpredetermined threshold, where the first bounding box is a bounding boxof the stacked body, and the second bounding box is a bounding box ofeach of other target objects other than the stacked body in an image. Inan example, the target object in the second bounding box can be a hand.The length of the overlapping area of the first bounding box and thesecond bounding box in the direction perpendicular to the stackingdirection of the stacked body can indicate a width of game currenciesshielded by the hand. The length of the first bounding box in thedirection perpendicular to the stacking direction of the stacked bodycan indicates a width of the stacked body. For example, assuming thatthere is only one the other target objects in the image and the othertarget object is a hand, if the ratio of the width of game currenciesshielded by the hand to the width of the stacked body is less than thesecond predetermined threshold (for example, the width of gamecurrencies shielded by human hands is 50%), it is determined that theimage can be taken as a sample image.

According to the method for obtaining sample images in embodiments ofthe present disclosure, game currencies included in the acquired imageare shielded by other objects as less as possible by filtering thequality of the acquired image, and have a higher quality so as tofacilitate improving the performance of a network trained by the sampleimages.

FIG. 6 is the structure of an apparatus for obtaining sample imagesprovided by an exemplary embodiment of the present disclosure. Theapparatus can be configured to implement a method for obtaining sampleimages in any one of embodiments of the present disclosure. As shown inFIG. 6, the apparatus can include: an image acquisition module 61 and animage filtering module 62.

The image acquisition module 61 is configured to acquire images ofstacked bodies, where the stacked bodies in different images havedifferent item information, and the item information includes: anattribute and a stacking mode of a stacked body.

The image filtering module 62 is configured to take an acquired image asa sample image when the acquired image meets an image quality condition.

In an example, the image acquisition module 61 is further configured toacquire a missing image when it is determined that the distribution dataof item information of stacked bodies in sample images of a sample imageset does not meet a predetermined distribution condition, where themissing image is an image of a stacked body having missing iteminformation not included in the distribution data but included in thepredetermined distribution condition; the sample image set includingmultiple sample images.

In an example, the image filtering module 62 is further configured totake the missing image as a sample image when the missing image meetsthe image quality condition.

In an example, the stacking mode includes: a stacking direction, astacking area, a neighboring relation among objects constituting thestacked body, and the number of objects in the stacked body; theattribute of the stacked body includes: a value represented by eachobject constituting the stacked body and a type of each object; stackedbodies in different sample images are different from each other in atleast one of: a stacking direction, a stacking area, a neighboringrelation among objects constituting a stacked body, the number ofobjects in a stacked body, a value represented by each objectconstituting a stacked body or a type of each object.

In an example, the image acquisition module 61 is configured to acquireN image subsets, where stacked bodies in images of the same image subsethave the same first attribute, the first attribute is one of the valueand the type, N is a natural number, and stacked bodies in images ofdifferent image subsets have different first attributes; where theattributes of stacked bodies in images of one of the N image subsetsinclude different possible combinations of second attributes, theattribute of the stacked body is determined by a second attribute ofeach object constituting the stacked body, and the second attribute isone of the value and the type other than the first attribute.

In an example, the image acquisition module 61 is configured to, whenthe stacking direction is parallel to a surface on which the stackedbody is placed, acquire images of stacked bodies at an overhead view ofthe surface.

In an example, the image acquisition module 61 is configured to, whenthe stacking direction is perpendicular to the surface on which thestacked body is placed, acquire images of stacked bodies at a side viewof the surface.

In an example, the image filtering module 62 is specifically configuredto for each of target objects in the acquired image, determine abounding box of the target object, the target objects including astacked body; for each of the target objects other than the stackedbody, determine that an Intersection over Union between a bounding boxof the stacked body and a bounding box of the target object is less thana first predetermined threshold; and take the acquired image as thesample image.

In an example, the image filtering module 62 is configured to, afterdetermining that the Intersection over Union between the bounding box ofthe stacked body and the bounding box of each of the target objectsother than the stacked body is less than the first predeterminedthreshold, and before taking the acquired image as the sample image,take the bounding box of the stacked body as a first bounding box; foreach of the target objects other than the stacked body in the acquiredimage, take the bounding box of the target object as a second boundingbox; determine that a ratio of a length of an overlapping area betweenthe first bounding box and the second bounding box in a directionperpendicular to a stacking direction of the stacked body to a length ofthe first bounding box in the direction perpendicular to the stackingdirection of the stacked body is less than a second predeterminedthreshold.

Also provided in the present disclosure is an electronic device,including a memory and a processor, where the memory is configured tostore computer instructions runnable on the processor, and the processoris configured to implement the method for obtaining sample imagesaccording to any one of embodiments of the present disclosure whenexecuting the computer instructions.

The present disclosure also provides a computer-readable storage medium.A computer program is stored thereon, and when the program is executedby a processor, the method for obtaining sample images according to anyone of embodiments of the present disclosure is implemented.

A person skilled in the art should understand that one or moreembodiments of the present disclosure may provide a method, a system ora computer program product. Therefore, one or more embodiments of thepresent disclosure may take the forms of hardware embodiments, softwareembodiments, or embodiments in combination with software and hardware.Moreover, one or more embodiments of the present disclosure may use theform of the computer program product implemented over one or morecomputer usable storage media (including but not limited to a diskmemory, a CD-ROM, and an optical memory, etc.) that include computerusable program codes.

Embodiments of the present disclosure further provide acomputer-readable storage medium, having a computer program storedthereon, where when the program is executed by a processor, steps of themethod for obtaining sample images described in any one of embodimentsof the present disclosure are implemented. In addition, the term“and/or” in the present disclosure means at least one of the two, e.g.,“A and/or B” includes three schemes: A, B, and “A and B”.

The embodiments in the present disclosure are all described in aprogressive manner, for same or similar parts in the embodiments, referto these embodiments, and each embodiment focuses on a difference fromother embodiments. In particular, data processing device embodiments aresubstantially similar to method embodiments and therefore are onlydescribed briefly, and for the associated part, refer to thedescriptions of the method embodiments.

The specific embodiments of the present disclosure are described above.Other embodiments are within the scope of the appended claims. In somecases, actions or steps described in the claims may be performed in anorder different from that in the embodiments and can still achieve adesired result. In addition, the processes described in the accompanyingdrawings do not necessarily require a specific order shown or asequential order to achieve the desired result. In some implementations,multi-task processing and parallel processing may also be performed ormay be advantageous.

The embodiments of the subject matter and functional operationsdescribed in the present disclosure may be implemented in digitalelectronic circuitry, tangible computer software or firmware, computerhardware including the structures disclosed in the present disclosureand structural equivalents thereof, or a combination of one or morethereof. The embodiments of the subject matter described in the presentdisclosure may be implemented as one or more computer programs, i.e.,one or more modules of computer program instructions encoded on atangible non-transitory program carrier to be executed by a dataprocessing apparatus or to control operations of the data processingapparatus. Alternatively or additionally, the program instructions maybe encoded on artificially generated propagated signals, such asmachine-generated electrical, optical or electromagnetic signals,generated to encode and transmit information to a suitable receiverapparatus for execution by the data processing apparatus. The computerstorage medium may be a machine-readable storage device, amachine-readable storage substrate, a random or serial access memorydevice, or a combination of one or more thereof.

The processes and logic flows described in the present disclosure can beperformed by one or more programmable computers executing one or morecomputer programs to perform corresponding functions by performingoperations according to input data and generating output. The processesand logic flows may also be performed by a special logic circuit, suchas a Field Programmable Gate Array (FPGA) or an Application SpecificIntegrated Circuit (ASIC), and the apparatus may also be implemented asa special logic circuit.

The computer suitable for executing the computer program includes, forexample, a general-purpose microprocessor and/or a special-purposemicroprocessor, any other type of central processing unit. Generally,the central processing unit receives instructions and data from aread-only memory and/or a random access memory. Basic components of thecomputer include a central processing unit for implementing or executinginstructions and one or more memory devices for storing instructions anddata. Generally, the computer further includes one or morelarge-capacity storage devices for storing data, for example, a magneticdisk, a magneto-optical disk, or an optical disk, or the computer isoperably coupled to the large-capacity storage device to receives datatherefrom or transmit data thereto, or receive data therefrom andtransmit data therefrom. However, the computer does not necessarilyinclude such a device. Furthermore, the computer may be embedded inanother device, for example, a mobile phone, a Personal DigitalAssistant (PDA), a mobile audio or a video player, a game console, aGlobal Positioning System (GPS) receiver, or a portable storage device,for example, a Universal Serial Bus (USB) flash drive, just a fewexamples provided.

A computer-readable medium suitable for storing computer programinstructions and data include a non-volatile memory, a medium, and amemory device in all forms, including, for example, a semiconductormemory device (for example, an EPROM, an EEPROM, and a flash device), amagnetic disk (for example, an internal hardware or a movable disk), amagneto-optical disk, and a CD ROM and DVD-ROM disk. The processor andthe memory may be supplemented by the special logic circuit orincorporated into the special logic circuit

Although the present disclosure includes many specific implementationdetails, these should not be interpreted as limiting the scope of anydisclosure or the scope of protection, and are mainly used fordescribing the features of specific embodiments of a specificdisclosure. Some features described in multiple embodiments in thepresent disclosure may also be implemented in combination in a singleembodiment. In addition, various features described in a singleembodiment may be implemented respectively in multiple embodiments or inany suitable sub-combination. Furthermore, although the features mayfunction in some combinations as described above and even set forth insuch a way initially, one or more features from a claimed combinationmay be removed from the combination in some cases, and the claimedcombination may relate to a sub-combination or a modification of thesub-combination.

Similarly, although operations are described in the accompanyingdrawings in a specific order, this should not be understood as requiringthat such operations are performed in the specific order shown or in asequential order, or that all illustrated operations are performed toachieve a desired result. In some cases, multi-task and parallelprocessing may be advantageous. Furthermore, the separation of varioussystem modules and components in the embodiments above should not beunderstood as requiring such separation in all embodiments, and itshould be understood that the described program components and systemscan generally be integrated together in a single software product orpackaged into multiple software products.

Thus, specific embodiments of the subject matter have been described.Other embodiments are within the scope of the appended claims. In somecases, the actions described in the claims can be performed in adifferent order and still achieve the desired result. In addition, theprocesses described in the accompanying drawings do not necessarilyrequire a specific order shown or a sequential order to achieve thedesired result. In some cases, multi-task and parallel processing may beadvantageous.

The above descriptions are only some embodiments of one or moreembodiments of the present disclosure and are not intended to limit oneor more embodiments of the present disclosure. Any modifications,equivalent substitutions and improvements made without departing fromthe spirit and principle of one or more embodiments of the presentdisclosure are intended to be included within the scope of one or moreembodiments of the present disclosure.

1. A method for obtaining sample images, comprising: acquiring images ofstacked bodies, wherein the stacked bodies in different images havedifferent item information, and the item information comprises: anattribute and a stacking mode of a stacked body; and taking an acquiredimage as a sample image when the acquired image meets an image qualitycondition.
 2. The method according to claim 1, further comprising:determining that distribution data of item information of stacked bodiesin sample images of a sample image set does not meet a predetermineddistribution condition, the sample image set comprising multiple sampleimages; and acquiring a missing image which is an image of a stackedbody having missing item information not included in the distributiondata but included in the predetermined distribution condition.
 3. Themethod according to claim 2, wherein after acquiring the missing image,the method further comprises: taking the missing image as a sample imagewhen the missing image meets the image quality condition.
 4. The methodaccording to claim 1, wherein, the stacking mode comprises: a stackingdirection, a stacking area, a neighboring relation among objectsconstituting the stacked body, and the number of objects in the stackedbody; the attribute of the stacked body comprises: a value representedby each object constituting the stacked body and a type of each object;stacked bodies in different sample images are different from each otherin at least one of: a stacking direction, a stacking area, a neighboringrelation among objects constituting a stacked body, the number ofobjects in a stacked body, or a value represented by each objectconstituting a stacked body and a type of each object.
 5. The methodaccording to claim 4, wherein acquiring images of stacked bodiescomprises: acquiring N image subsets, wherein stacked bodies in imagesof the same image subset have the same first attribute, the firstattribute is one of the value and the type, N is a natural number, andstacked bodies in images of different image subsets have different firstattributes; wherein the attributes of stacked bodies in images of one ofthe N image subsets include different possible combinations of secondattributes, the attribute of the stacked body is determined by a secondattribute of each object constituting the stacked body, and the secondattribute is one of the value and the type other than the firstattribute.
 6. The method according to claim 4, wherein when the stackingdirection is parallel to a surface on which the stacked body is placed,acquiring images of stacked bodies comprises: acquiring images ofstacked bodies at an overhead view of the surface.
 7. The methodaccording to claim 4, wherein when the stacking direction isperpendicular to the surface on which the stacked body is placed,acquiring images of stacked bodies comprises: acquiring images ofstacked bodies at a side view of the surface.
 8. The method according toclaim 1, wherein taking the acquired image as the sample image when theacquired image meets the image quality condition comprises: for each oftarget objects in the acquired image, determining a bounding box of thetarget object, the target objects comprising a stacked body; for each ofthe target objects other than the stacked body, determining that anIntersection over Union between a bounding box of the stacked body and abounding box of the target object is less than a first predeterminedthreshold; and taking the acquired image as the sample image.
 9. Themethod according to claim 8, wherein after determining that theIntersection over Union between the bounding box of the stacked body andthe bounding box of each of the target objects other than the stackedbody is less than the first predetermined threshold, and before takingthe acquired image as the sample image, the method further comprises:taking the bounding box of the stacked body as a first bounding box; foreach of the target objects other than the stacked body in the acquiredimage, and taking the bounding box of the target object as a secondbounding box; and determining that a ratio of a length of an overlappingarea between the first bounding box and the second bounding box in adirection perpendicular to a stacking direction of the stacked body to alength of the first bounding box in the direction perpendicular to thestacking direction of the stacked body is less than a secondpredetermined threshold.
 10. An electronic device, comprising: a memorystoring computer instructions, and a processor, wherein when executingthe computer instructions, the processor is configured to performactions comprising: acquiring images of stacked bodies, wherein thestacked bodies in different images have different item information, andthe item information comprises: an attribute and a stacking mode of astacked body; and taking an acquired image as a sample image when theacquired image meets an image quality condition.
 11. The electronicdevice according to claim 10, wherein the actions further comprise:determining that distribution data of item information of stacked bodiesin sample images of a sample image set does not meet a predetermineddistribution condition, the sample image set comprising multiple sampleimages; and acquiring a missing image which is an image of a stackedbody having missing item information not included in the distributiondata but included in the predetermined distribution condition.
 12. Theelectronic device according to claim 11, wherein after acquiring themissing image, the actions further comprise: taking the missing image asa sample image when the missing image meets the image quality condition.13. The electronic device according to claim 10, wherein, the stackingmode comprises: a stacking direction, a stacking area, a neighboringrelation among objects constituting the stacked body, and the number ofobjects in the stacked body; the attribute of the stacked bodycomprises: a value represented by each object constituting the stackedbody and a type of each object; stacked bodies in different sampleimages are different from each other in at least one of: a stackingdirection, a stacking area, a neighboring relation among objectsconstituting a stacked body, the number of objects in a stacked body, ora value represented by each object constituting a stacked body and atype of each object.
 14. The electronic device according to claim 13,wherein acquiring images of stacked bodies comprises: acquiring N imagesubsets, wherein stacked bodies in images of the same image subset havethe same first attribute, the first attribute is one of the value andthe type, N is a natural number, and stacked bodies in images ofdifferent image subsets have different first attributes; wherein theattributes of stacked bodies in images of one of the N image subsetsinclude different possible combinations of second attributes, theattribute of the stacked body is determined by a second attribute ofeach object constituting the stacked body, and the second attribute isone of the value and the type other than the first attribute.
 15. Theelectronic device according to claim 13, wherein when the stackingdirection is parallel to a surface on which the stacked body is placed,acquiring images of stacked bodies comprises: acquiring images ofstacked bodies at an overhead view of the surface.
 16. The electronicdevice according to claim 13, wherein when the stacking direction isperpendicular to the surface on which the stacked body is placed,acquiring images of stacked bodies comprises: acquiring images ofstacked bodies at a side view of the surface.
 17. The electronic deviceaccording to claim 10, wherein taking the acquired image as the sampleimage when the acquired image meets the image quality conditioncomprises: for each of target objects in the acquired image, determininga bounding box of the target object, the target objects comprising astacked body; for each of the target objects other than the stackedbody, determining that an Intersection over Union between a bounding boxof the stacked body and a bounding box of the target object is less thana first predetermined threshold; and taking the acquired image as thesample image.
 18. The electronic device according to claim 17, whereinafter determining that the Intersection over Union between the boundingbox of the stacked body and the bounding box of each of the targetobjects other than the stacked body is less than the first predeterminedthreshold, and before taking the acquired image as the sample image, theactions further comprise: taking the bounding box of the stacked body asa first bounding box; for each of the target objects other than thestacked body in the acquired image, and taking the bounding box of thetarget object as a second bounding box; and determining that a ratio ofa length of an overlapping area between the first bounding box and thesecond bounding box in a direction perpendicular to a stacking directionof the stacked body to a length of the first bounding box in thedirection perpendicular to the stacking direction of the stacked body isless than a second predetermined threshold.
 19. A non-transitorycomputer-readable storage medium, having a computer program storedthereon, wherein when the program is executed by a processor, theprocessor is caused to perform actions comprising: acquiring images ofstacked bodies, wherein the stacked bodies in different images havedifferent item information, and the item information comprises: anattribute and a stacking mode of a stacked body; and taking an acquiredimage as a sample image when the acquired image meets an image qualitycondition.
 20. The non-transitory computer-readable storage mediumaccording to claim 19, wherein the actions further comprise: determiningthat distribution data of item information of stacked bodies in sampleimages of a sample image set does not meet a predetermined distributioncondition, the sample image set comprising multiple sample images; andacquiring a missing image which is an image of a stacked body havingmissing item information not included in the distribution data butincluded in the predetermined distribution condition.